<div class="choose-league-title"> 选择杯赛淘汰赛
<select name="select-league" id="select-league">
<?php foreach($this->my_cups as $cup){?>
  <option value ="<?php echo $cup['cup_ko_id'] ?>"
          <?php if($this->actuel_cup_id ==$cup['cup_ko_id']){
          	    echo 'selected="selected"';
          }?>><?php echo $cup['name'] ?></option>
 <?php }?>
</select>

</div>
<div class="league-title"><?php echo $this->actuel_cup_name;?></div>
<div>
待确认比赛 (客场 : 主场)
<?php foreach ($this->to_confirm_games as $group_name =>$group){
	if(!empty($group)){?>
<div> 第<?php echo $group_name?>轮</div>
<?php foreach ($group as $game){?>


<div class="score">
<div class="away-team"><?php echo $game['away_team_name']?></div>
<div class="away-team-score"><?php echo $game['away_team_score'] ; ?></div>
<div class="home-team-score"><?php echo $game['home_team_score'] ; ?></div>
<div class="home-team"><?php echo $game['home_team_name']?></div>

<div class="confirm-game"><a href="/user/cup-ko-confirm-game/game-id/<?php echo $game['id'];?>"
                             onclick="return confirm('<?php echo $game['away_team_name']?> : <?php echo $game['home_team_name']?> \n<?php echo $game['away_team_score'] ; ?> : <?php echo $game['home_team_score'] ; ?>\n确认比分? ');">确认比分</a> </div>

</div>
<?php } 
}}?>

</div>


<div>
待录入比赛 (客场 : 主场)

<?php foreach ($this->new_games as $group_name =>$group){
	if(!empty($group)){?>
<div> 第<?php echo $group_name?>轮</div>

<?php foreach ($group as $game){?>


<div class="score" id="<?php echo $game['id'];?>">
<div class="away-team"><?php echo $game['away_team_name']?></div>
<div class="away-team-score"><?php echo $game['away_team_score'] ; ?></div>
<div class="home-team-score"><?php echo $game['home_team_score'] ; ?></div>
<div class="home-team"><?php echo $game['home_team_name']?></div>

<div class="confirm-game ko-input-game " style="cursor:pointer">录入比分</div>


</div>
<?php } 
}}?>


</div>
<div id="user-input-dialog">
    <form action="" method ="post">
    <div class="away-team"></div>
<div class="away-team-score"><input type="text" name="away_team_score"  value="" size="5" /> &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;</div>

<div class="home-team-score"><input type="text" name="home_team_score"  value="" size="5" /></div>
<div class="home-team"></div>
<input id="" class="button" type="submit" value="    确定    " style="margin-left : 100px" />
    </form>
</div>



<script type="text/javascript">
<!--//--><![CDATA[//><!--
$(document).ready(function() {
    $('#select-league').change(function(){
        window.location=window.location.pathname + '?cup_id='+$(this).val();
    });



    $(".ko-input-game").each(function(){                 
    	  $(this).click(function(){
    		  $('#user-input-dialog form').attr('action' , '/user/ko-cup-input-score/game-id/'+ $(this).parent().attr('id'));

    		  $('#user-input-dialog .away-team').html($(this).prev().prev().prev().prev().html());
    		  $('#user-input-dialog .home-team').html($(this).prev().html());
			
    		  $('#user-input-dialog').bPopup();
        	   })
    });

})

//--><!]]>
</script>

         